#ifndef _INTERNAL_FLASH_H_
#define _INTERNAL_FLASH_H_

#include "main.h"
#include <stdint.h>

/* FLASH大小：STM32F103C6T6:32K */
#define STM32FLASH_SIZE                 0x00010000UL

/* FLASH起始地址 */
#define STM32FLASH_BASE                 FLASH_BASE

/* FLASH结束地址 */
#define STM32FLASH_END                  (STM32FLASH_BASE | STM32FLASH_SIZE)

/* FLASH页大小：1K */
#define STM32FLASH_PAGE_SIZE            FLASH_PAGE_SIZE

/* FLASH总页数 */
#define STM32FLASH_PAGE_NUM             (STM32FLASH_SIZE / STM32FLASH_PAGE_SIZE)

#define WRITE_START_ADDR                ((uint32_t)STM32FLASH_BASE)
#define WRITE_END_ADDR                  ((uint32_t)STM32FLASH_END)

/* 配置参数保存地址 */
#define mSYSTEM_CONFIG_PARAMS_SAVE_ADDR (STM32FLASH_BASE + STM32FLASH_PAGE_SIZE * 31)


uint32_t Internal_Flash_Read( uint32_t addrStart, void *pData, uint32_t dataLen );
uint32_t Internal_Flash_Write( uint32_t addrStart, const uint8_t *pData, uint32_t dataLen );


#endif




